package com.cmdb.system.domain;

import com.cmdb.common.annotation.Excel;
import com.cmdb.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;
import java.util.List;

/**
 * 邮件发送记录对象 sys_email_log
 */
public class SysEmailLog extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 日志ID */
    private Long logId;

    /** 发送用户ID */
    @Excel(name = "发送用户")
    private Long userId;

    /** 发件人邮箱 */
    @Excel(name = "发件人邮箱")
    private String fromEmail;

    /** 发件人显示名称 */
    @Excel(name = "发件人名称")
    private String fromName;

    /** 收件人邮箱，多个用分号分隔 */
    @Excel(name = "收件人邮箱")
    private String toEmail;

    /** 抄送邮箱，多个用分号分隔 */
    @Excel(name = "抄送邮箱")
    private String ccEmail;

    /** 密送邮箱，多个用分号分隔 */
    @Excel(name = "密送邮箱")
    private String bccEmail;

    /** 邮件主题 */
    @Excel(name = "邮件主题")
    private String subject;

    /** 邮件内容 */
    @Excel(name = "邮件内容")
    private String content;

    /** 内容类型（text纯文本 html网页） */
    @Excel(name = "内容类型", readConverterExp = "text=纯文本,html=网页")
    private String contentType;

    /** 重要等级（0普通 1重要 2紧急） */
    @Excel(name = "重要等级", readConverterExp = "0=普通,1=重要,2=紧急")
    private String importance;

    /** 发送状态（0成功 1失败） */
    @Excel(name = "发送状态", readConverterExp = "0=成功,1=失败")
    private String sendStatus;

    /** 发送时间 */
    @Excel(name = "发送时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date sendTime;

    /** 错误信息 */
    @Excel(name = "错误信息")
    private String errorInfo;

    /** 附件列表 */
    private List<SysEmailAttachment> attachments;

    public Long getLogId() {
        return logId;
    }

    public void setLogId(Long logId) {
        this.logId = logId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getFromEmail() {
        return fromEmail;
    }

    public void setFromEmail(String fromEmail) {
        this.fromEmail = fromEmail;
    }

    public String getFromName() {
        return fromName;
    }

    public void setFromName(String fromName) {
        this.fromName = fromName;
    }

    public String getToEmail() {
        return toEmail;
    }

    public void setToEmail(String toEmail) {
        this.toEmail = toEmail;
    }

    public String getCcEmail() {
        return ccEmail;
    }

    public void setCcEmail(String ccEmail) {
        this.ccEmail = ccEmail;
    }

    public String getBccEmail() {
        return bccEmail;
    }

    public void setBccEmail(String bccEmail) {
        this.bccEmail = bccEmail;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getContentType() {
        return contentType;
    }

    public void setContentType(String contentType) {
        this.contentType = contentType;
    }

    public String getImportance() {
        return importance;
    }

    public void setImportance(String importance) {
        this.importance = importance;
    }

    public String getSendStatus() {
        return sendStatus;
    }

    public void setSendStatus(String sendStatus) {
        this.sendStatus = sendStatus;
    }

    public Date getSendTime() {
        return sendTime;
    }

    public void setSendTime(Date sendTime) {
        this.sendTime = sendTime;
    }

    public String getErrorInfo() {
        return errorInfo;
    }

    public void setErrorInfo(String errorInfo) {
        this.errorInfo = errorInfo;
    }

    public List<SysEmailAttachment> getAttachments() {
        return attachments;
    }

    public void setAttachments(List<SysEmailAttachment> attachments) {
        this.attachments = attachments;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
            .append("logId", getLogId())
            .append("userId", getUserId())
            .append("fromEmail", getFromEmail())
            .append("fromName", getFromName())
            .append("toEmail", getToEmail())
            .append("ccEmail", getCcEmail())
            .append("bccEmail", getBccEmail())
            .append("subject", getSubject())
            .append("content", getContent())
            .append("contentType", getContentType())
            .append("importance", getImportance())
            .append("sendStatus", getSendStatus())
            .append("sendTime", getSendTime())
            .append("errorInfo", getErrorInfo())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .toString();
    }
} 